package edu.bbu.license.client.android.services.file;

import android.content.Intent;
import edu.bbu.license.client.android.application.MainApplication;
import edu.bbu.license.client.android.services.BaseServiceProvider;
import edu.bbu.license.client.android.services.file.worker.FileService;
import edu.bbu.license.client.android.services.file.worker.SimpleFileService;

public class FileServiceProvider extends BaseServiceProvider {

	private static FileService fileService = new SimpleFileService();
	
	@Override
	public int onStartCommand(Intent intent, int flags, int startId) {
		return START_STICKY;
	}
	
	public FileService getFileService() {
		startService();	
		return fileService;
	}
	
	@Override
	protected void startService() {
		MainApplication mainApplication = MainApplication.getInstance();
		mainApplication.startService(new Intent(mainApplication, FileServiceProvider.class));
	}
}
